from dbshop1.public.action import *
from dbshop1.public.business import *
from dbshop1.public.testData import *
from dbshop1.public.tools import*
testCase="DBshop030_添加普通商品标签"
#打开网页并实例化
llq=openBrowser(urlAdmin)
#登入后台页面
DBshopLoginAdmin(llq)
#进入商品标签页面
DBshopEnterMenu3(llq,"商品管理","商品标签","普通商品标签")
#进入添加商品标签并添加
llq.find_element_by_partial_link_text(" 添加普通商品标签").click()
llq.find_element_by_xpath('//select[@id="tag_group_id"]/option[2]').click()
llq.find_element_by_id("tag_name").send_keys("华为手机，华为耳机")
llq.find_element_by_xpath('//button[@class="btn btn-small btn-primary"]').click()
#断言
try:
    llq.find_element_by_xpath('//td[contains(.,"华为手机，华为耳机")]')
    writeLog("%s 测试通过"%testCase)
except:
    writeLog("%s 测试失败" % testCase)
    getPhoto(llq)
llq.quit()